These examples are about colors and fonts in normal (unselected) items/subitems.

Scripts 1 - 6 contains four listviews. The listviews to the left is about back and fore colors. The listviews to the right is about fonts and styles. The upper listviews contains 100 rows. The lower listviews contains 1000 rows.

Colors, fonts and styles can be deleted and added with the buttons. This also removes/adds subclassing from/to the current listview (more precisely the parent window of the listview). If all colors, fonts and styles are deleted, subclassing is effectively removed and the UDF is not used at all.

The fact that it's possible to remove/add subclassing dynamically in this way with the buttons shows to some extent the stability of the four new functions (SetWindowSubclass, GetWindowSubclass, RemoveWindowSubclass and DefSubclassProc) to implement subclassing. It probably would have been impossible with the old SetWindowLong function. The stability of the functions is necessary in order to use them in a UDF.

In all scripts a WM_NOTIFY message handler is created with GUIRegisterMsg to be able to catch double click and Enter key in the listviews. Note that the message handler is working whether subclassing is enabled or not.

The six scripts are numbered after performance. 1 is best. 6 is worst. In relation to the UDF, listviews in child windows and non-native listview items are most efficient.

The six scripts (ranked by performance):
1) Listviews created in child windows, non-native listview items
2) Listviews created in child windows, native listview items
3) Upper listviews in one child window, lower listviews in another child window, non-native listview items
4) Left listviews created in child windows, right listviews created in GUI, non-native listview items
5) Listviews created directly in GUI, non-native listview items
6) Listviews created directly in GUI, native listview items

When you run the scripts it's difficult to notice any difference in performance. Only four listviews and relatively simple GUIs is not enough to make a difference.

Note also the usage of ListViewColorsFonts_Redraw. And note the usage of _GUICtrlListView_BeginUpdate and _GUICtrlListView_EndUpdate in the code for button click events in the main message loop.


Scripts 7 - 9: Non-native listviews created directly in GUI with _GUICtrlListView_Create

The three scripts contains a WM_NOTIFY and a WM_ACTIVATE message handler created with GUIRegisterMsg.
